<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>JQueryDom操作</title>
		<link rel="stylesheet" type="text/css" href="css/txt.css" />
		<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<input type="checkbox" id="nid" value="1">新闻1</input>
		<input type="checkbox" id="nid" value="2">新闻2</input>
		<input type="checkbox" id="nid" value="3">新闻3</input>
		<input type="checkbox" id="nid" value="4">新闻4</input>
		<input type="checkbox" id="nid" value="5">新闻5</input>
	</body>

	<script type="text/javascript">
		$(function() {
			// 获取所有的checkbox中的value值
			$("[id=nid]").each(function(){
				console.log($(this).val());
			});
		});
	</script>

</html>